<SCRIPT language=JavaScript>
var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
</SCRIPT>
<style type="text/css">
<!--
@import url("../estilo.css");
-->
</style>
<?PHP include("config.php");
require_once "sql_inject.php"; 
$bDestroy_session = TRUE; 
$url_redirect = 'index.php'; 
$sqlinject = new sql_inject('./log_file_sql.log',$bDestroy_session,$url_redirect)  ; 

$sqlinject->test($msquery); 
?>
<title>==Painel de Controle== [Mu Duel]</title><head>
<style type=text/css>
body{
scrollbar-face-color:#0066FF; 
scrollbar-highlight-color:#0066FF; 
scrollbar-3dlight-color:#0066FF; 
scrollbar-darkshadow-color:#000000; 
scrollbar-shadow-color:333333; 
scrollbar-arrow-color:0099FF; 
scrollbar-track-color:#000000;
font-family:Arial;
font-size:2;
}
.forms {font-family:arial;
font-size:12px;
font-family:Arial;
background-color:#222222;
color:#DDDDDD;
font-weight:bold;
border:1 solid #FFFFFF}
a {
color:#FFFFFF;
text-decoration: none;
}
a:hover {
color:#FFFFFF;
text-decoration: underline; 
}
.style1 {
	color: #FFFFFF;
	font-weight: bold;
}
.style3 {color: #FFFFFF}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body bgcolor="#000000" text="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align="center"></div>
<p align="center">&nbsp;</p>
<p align="center">&nbsp;</p>
<table width="500" height="457" border="0" align="center" cellpadding="2" cellspacing="2" bordercolor="#CCCCCC" bgcolor="#000000">
  <tr><td width="33%" height="453" align="center" valign="top"><p align="center"> 
        <?php if ((isset($_COOKIE['login'])) AND (isset($_COOKIE['pass']))) {
$login = $_COOKIE['login'];
$senha = $_COOKIE['pass'];
$sql = "SELECT memb___id FROM MEMB_INFO WHERE memb___id='$login' AND memb__pwd='$senha'";
$sqlinject->test($sql); 
$sql = mssql_query($sql); 
$logado = mssql_num_rows($sql);
if ($logado <= 0) {
echo '<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td><div align="justify"><font size="2" face="Courier New, Courier, mono">
Area Acessecivel Apenas Para Usuarios Logados<BR><BR><BR><BR></div></td></tr>
<tr><td height="25" valign="top"><div align="center"><font color="#B30000" size="4" face="Courier New, Courier, mono"><strong>ACESSO USU&Aacute;RIOS </strong></font></div></td>
</tr><tr><td><form name="form1" method="post" action="logar.php">
<table width="100%"  border="0" cellspacing="1" cellpadding="1">
<tr><td><div align="right"><strong><font color="#B30000" size="3" face="Courier New, Courier, mono">Login:</font></strong></div></td>
<td><span class="style13"><INPUT name=login class="forms" id="login" size=15 maxLength=15>
</span></td></tr><tr><td><div align="right"><strong><font color="#B30000" size="3" face="Courier New, Courier, mono">Senha:</font></strong></div></td>
<td><span class="style11 style14"><INPUT name=senha type=password class="forms" id="senha" size=15 maxLength=15>
</span></td></tr><tr><td><div align="right"></div></td><td><span class="style13">
<input name="cria" type="submit" class="forms" id="cria" value="ENTRAR"></td></tr></table>
</form></td></tr><tr><td>&nbsp;</td></tr></table>';
exit(); } 

echo '<table width="100%"  border="0" cellspacing="7" cellpadding="0"><tr>
<td align="right" valign="middle"><div align="center"><font color="#FFFFFF" size="3" face="Courier New"><strong>Ol&aacute; ';
	echo $_COOKIE["nome"];
	echo '!</div><br></td>
  </tr><tr>
    <td align="right" valign="middle"><a href="manager.php"><font size="2" face="Courier New"><strong>Minha Conta</a></td>
  </tr><tr>
    <td align="right" valign="middle"><a href="mudasenha.php"><font size="2" face="Courier New"><strong>Mudar Senha</a></td>
  </tr>    <tr>
    <td align="right" valign="middle"><a href="pontos.php"><font size="2" face="Courier New"><strong>Distribuir Pontos</a></td>
  </tr><tr>
    <td align="right" valign="middle"><a href="pk.php"><font size="2" face="Courier New"><strong>Limpar PK</a></td>
  </tr><tr>
    <td align="right" valign="middle"><a href="logout.php"><font size="2" face="Courier New"><strong>Sair</a></td>
  </tr></table>';
} else {
echo '<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td><div align="center"><font size="2" face="Courier New, Courier, mono" color="#B30000">
<BR><BR>Area Assesivel Apenas Para Usuarios Lggados<BR>Loge-se e Diverta-se<BR><BR><BR></div></td></tr>
<tr><td height="25" valign="top"><div align="center"><font color="#B30000" size="4" face="Courier New, Courier, mono"><strong>Painel do Usuario</strong></font></div></td>
</tr><tr><td><form name="form1" method="post" action="logar.php">
<table width="100%"  border="0" cellspacing="1" cellpadding="1">
<tr><td><div align="right"><strong><font color="#B30000" size="3" face="Courier New, Courier, mono">Login:</font></strong></div></td>
<td><span class="style13"><INPUT name=login class="forms" id="login" size=15 maxLength=15>
</span></td></tr><tr><td><div align="right"><strong><font color="#B30000" size="3" face="Courier New, Courier, mono">Senha:</font></strong></div></td>
<td><span class="style11 style14"><INPUT name=pass type=password class="forms" id="pass" size=15 maxLength=15>
</span></td></tr><tr><td><div align="right"></div></td><td><span class="style13">
<input name="cria" type="submit" class="forms" id="cria" value="Entrar"></td></tr></table>
</form></td></tr><tr><td>&nbsp;</td></tr></table>';
exit(); } ?>
      </p>
      <p align="center">&nbsp;</p></td><td width="67%" align="center" valign="top"><div align="center">
<p class="style1"><font size="1" face="Courier New, Courier, mono">RESET DE PK</font></p>
	<?
	if (!isSet($_POST['name'])) { ?>

<form name="pk" method="post" action="">
  <table border=0 align=center cellpadding=5 cellspacing=1>
    <tbody>
      <tr valign="top">
        <td width="100%" height="40" align=center><div align="center" class=""><span class="style3">
            Selecione seu Personagem
                </span>
          <p class="style3 "><?
$query = "select Name from Character where AccountID = '$login'";
$result = mssql_query($query);
for($i=0;$i<mssql_num_rows($result);++$i)
{
$row = mssql_fetch_row($result);
echo '<input name="name" type="submit" value="';
echo $row[0];
echo '" class="forms"> ';
}
$conn=mssql_close();
?></p></div></td></tr></table></form>
        <?	
	} else {
$name = stripslashes($_POST['name']);
$name = htmlspecialchars($name,ENT_QUOTES);
$login = stripslashes($_COOKIE['login']);
$login = htmlspecialchars($login,ENT_QUOTES);

$preco = 1000000;

$pklevel = "SELECT PkLevel FROM Character WHERE PkLevel > 3 and Name='$name'";
$sqlinject->test($pklevel);
$pklevel = @mssql_query($pklevel);
$pklevel = @mssql_num_rows($pklevel);

$temgrana = "SELECT Money FROM Character WHERE Money >= $preco * PkCount and Name='$name'";
$sqlinject->test($temgrana);
$temgrana = @mssql_query($temgrana);
$temgrana = @mssql_num_rows($temgrana);

if ($pklevel <= 0) {
die('<b><font color="#FFFFFF">Seu personagem não está PK!</b>'); }

if ($temgrana <= 0){ 
$pena = "SELECT PkCount FROM Character WHERE Name='$name'";
$sqlinject->test($pena);
$pena = @mssql_query($pena);
$pena = @mssql_result($pena, 0,0);
$quanto = $preco * $pena;
echo "<br><br>Você não tem o ZEN necessário no inventário!<br>
Neste caso, você precisará de <b>$quanto</b> para limpar seu PK.<br>"; }

else {
$msquery = "UPDATE Character
SET PkLevel = '3',
Money = Money - 1000000,
PkCount = '0',
PkTime = '0'
WHERE AccountID = '$login'
AND Name = '$name'
";
$msresults= @mssql_query($msquery) or die('ERRO! TENTE MAIS TARDE!');
echo "<BR><b>$name</b> foi perdoado com sucesso!<BR>"; }
}
function anti_injection($sql)
{
	// remove palavras que contenham sintaxe sql
	$sql = preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|\*|--|\\\\)/"),"",$sql);
	$sql = trim($sql);//limpa espaços vazio
	$sql = strip_tags($sql);//tira tags html e php
	$sql = addslashes($sql);//Adiciona barras invertidas a uma string
	return $sql;
}	?>
        <p>&nbsp;</p>
      </div></td>
</tr></table>
</body></html>